#include "SafeBoxInterface.h"


ISafeBoxInterface* GetSafeBoxInterface()
{
    static IClassFactory* pClassFactory = NULL;
    typedef HRESULT(STDMETHODCALLTYPE* PFN_DllGetClassObject)(REFCLSID rclsid, REFIID riid, void** ppv);

    ISafeBoxInterface* pInterface = NULL;

    if (NULL == pClassFactory)
    {
        DllGetClassObject(IID_IUnknown, IID_IClassFactory, (void**)&pClassFactory);
    }

    if (NULL == pClassFactory)
    {
        return FALSE;
    }

    pClassFactory->CreateInstance(NULL, __uuidof(ISafeBoxInterface), (void**)&pInterface);

    return pInterface;
}
